﻿using AutoMapper;
using Microsoft.AspNetCore.Mvc;
using sixgod.Base.Controllers;
using sixgod.Dtos.User;
using sixgod.Service.User;

namespace sixgod.Module.User.Controllers
{
    [Route("[Controller]")]
    public class JobController:BaseController
    {
        private readonly IJobService _jobService;
        private readonly IMapper _mapper;

        public JobController(IJobService jobService, IMapper mapper)
        {
            this._jobService = jobService;
            this._mapper = mapper;
        }

        /// <summary>
        /// 获取全部职位
        /// </summary>
        /// <returns></returns>
        [HttpGet("all")]
        public async Task<IActionResult> GetAllList()
        {
            var list = await _jobService.GetListAsync();
            var result = _mapper.Map<List<JobDto>>(list);
            return Success(result);
        }
    }
}
